<?php
/**
 * User: hjd-yao
 * Date: 2018/12/14
 * Time: 10:12
 */

namespace Develop\Providers;


use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;

class DevelopServiceProvider extends ServiceProvider
{
    protected $namespace = 'Develop\Http\Controllers';

    public function boot()
    {
        $this->registerRoutes();
        $this->registerViews();
    }

    public function register()
    {

    }

    private function registerRoutes()
    {
        Route::namespace($this->namespace)
            ->middleware(['web','CheckIsLogin'])
            ->prefix('develop')
            ->group(__DIR__.'/../Routes/web.php');
    }

    private function registerViews()
    {
        $viewPath = realpath(__DIR__.'/../Resources/views/'.config('app.backend_theme').'/');
        $this->loadViewsFrom($viewPath,'develop');
    }
}